﻿// Decompiled with JetBrains decompiler
// Type: TaleWorlds.CampaignSystem.MapTimeTracker
// Assembly: TaleWorlds.CampaignSystem, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: E85F8C15-4DF6-4E9C-A58A-29177E40D07A
// Assembly location: D:\steam\steamapps\common\Mount & Blade II Bannerlord\bin\Win64_Shipping_Client\TaleWorlds.CampaignSystem.dll

using System.Collections.Generic;
using TaleWorlds.SaveSystem;

#nullable disable
namespace TaleWorlds.CampaignSystem
{
  internal class MapTimeTracker
  {
    [SaveableField(0)]
    private long _numTicks;
    [SaveableField(1)]
    private long _deltaTimeInTicks;

    internal static void AutoGeneratedStaticCollectObjectsMapTimeTracker(
      object o,
      List<object> collectedObjects)
    {
      ((MapTimeTracker) o).AutoGeneratedInstanceCollectObjects(collectedObjects);
    }

    protected virtual void AutoGeneratedInstanceCollectObjects(List<object> collectedObjects)
    {
    }

    internal static object AutoGeneratedGetMemberValue_numTicks(object o)
    {
      return (object) ((MapTimeTracker) o)._numTicks;
    }

    internal static object AutoGeneratedGetMemberValue_deltaTimeInTicks(object o)
    {
      return (object) ((MapTimeTracker) o)._deltaTimeInTicks;
    }

    internal long NumTicks => this._numTicks;

    internal long DeltaTimeInTicks => this._deltaTimeInTicks;

    internal MapTimeTracker(CampaignTime initialMapTime)
    {
      this._numTicks = initialMapTime.NumTicks;
    }

    internal MapTimeTracker() => this._numTicks = 0L;

    internal CampaignTime Now => new CampaignTime(this._numTicks);

    internal void Tick(float seconds)
    {
      this._deltaTimeInTicks = (long) ((double) seconds * 10000.0);
      this._numTicks += this._deltaTimeInTicks;
    }
  }
}
